<template>
  <vcu-chart-line :loadOptions="loadOptions" @onChartLoaded="onChartLoaded" @onDataLoaded="onDataLoaded"></vcu-chart-line>
</template>

<script>
export default {
  name: 'loadedEvent',
  data() {
    return {
      loadOptions: {
        chartUrl: 'dataq/api/chart/chartTestApi',
        dataUrl: 'dataq/api/page/chartTestApi',
      },
    }
  },
  methods: {
    onChartLoaded({ chartsType, dimensions, measures, settings, settingsForArea }) {
      this.$message.success('图表配置加载完成')
      console.log(chartsType, dimensions, measures, settings, settingsForArea)
    },
    onDataLoaded({ dimensions, measures }) {
      this.$message.success('图表数据加载完成')
      console.log(dimensions, measures)
    },
  },
}
</script>
